﻿
///Those namespace classes are used to return data
namespace InnovaApp.Portals.MVC4Portal.Models.JSonModels
{
	/// <summary>
	/// 
	/// </summary>
	public class OrderDetail_JSonModel
	{
		public bool success { get; set; }
		public string productDescription { get; set; }
		public double unitPrice { get; set; }
		public double totalPrice { get; set; }
		public double appliedVATRate { get; set; }
		public double vatTotal { get; set; }
		public double allTaxeIncludedTotal { get; set; }

		public bool updateTotals { get; set; }

		public double totals_ExcludingTaxesTotal { get; set; }
		public double totals_TaxesTotal { get; set; }
		public double totals_IncludedTaxesTotal { get; set; }

		public string message { get; set; }

		public object Data
		{
			get
			{
				if (this.success)
				{
					return new
					{
						@success = this.success,
						@productDescription = this.productDescription,
						@unitPrice = string.Format("{0:0.00}", this.unitPrice),
						@totalPrice = string.Format("{0:0.00}", this.totalPrice),
						@appliedVATRate = string.Format("{0:0.00}", this.appliedVATRate),
						@vatTotal = string.Format("{0:0.00}", this.vatTotal),
						@allTaxeIncludedTotal = string.Format("{0:0.00}", this.allTaxeIncludedTotal),
						@updateTotals = this.updateTotals,
						@totals_ExcludingTaxesTotal = string.Format("{0:0.00}", this.totals_ExcludingTaxesTotal),
						@totals_TaxesTotal = string.Format("{0:0.00}", this.totals_TaxesTotal),
						@totals_IncludedTaxesTotal = string.Format("{0:0.00}", this.totals_IncludedTaxesTotal),
					};
				}
				else
				{
					return new
					{
						@success = this.success,
						@message = this.message
					};
				}
			}
		}
	}
}